﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProductList.aspx.cs" Inherits="HelloASPX.ProductList" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>商品列表页</title>
    <link href="./css/bootstrap.min.css" rel="stylesheet"/>
    <script type="text/javascript" src="./js/jquery.min.js"></script>
</head>
<body>
    <form id="form1" runat="server">
        <header style="width:100%; height:70px;">
		<div class="logo"><a href="ProductList.aspx"><img src="./img/logo.png" style="width:150px;height:70px;"/></a>
            <asp:Button ID="Button1" runat="server" Text="用户管理" style="margin:10px 20px; border:0; background-color:skyblue; color:aliceblue; height:50px;" OnClick="useradminButton_Click"/>
            <asp:Button ID="Button3" runat="server" Text="添加商品" style="margin:10px 20px; border:0; background-color:skyblue; color:aliceblue; height:50px;" OnClick="AddProduct_Click"/>
        </div>
		<div class="useradmin">
		</div>
	</header>
        <div class="panel panel-default" style="margin: 0 auto;width: 95%;">
            <div class="panel-heading">
	            <h3 class="panel-title"><span class="glyphicon glyphicon-th-list"></span>&nbsp;&nbsp;商品列表</h3>
	        </div>
            <div class="panel-body">
                <!--列表开始-->
                <div class="row" style="margin: 0 auto;">
        <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/App_Data/products.xml" TransformFile="~/App_Data/products.xslt" XPath="/products/product"></asp:XmlDataSource>
        <asp:DataList ID="DataList1" runat="server" DataSourceID="XmlDataSource1" repeatlayout="flow" RepeatDirection="Horizontal">
            <ItemTemplate>
                <div class="col-sm-3">
                    <div class="thumbnail" style="width: 350px; height: 320px; margin:10px auto;">
                        <asp:Image ID="Image2" runat="server" ImageUrl='<%# Eval("pimage") %>' style="width:180px;height:180px;"/>
                        <div class="caption">
                            <h4>商品名称： <asp:Label ID="Label1" runat="server" Text='<%# Eval("pname") %>' /></h4>
                            <p>上架日期: <asp:Label ID="Label2" runat="server" Text='<%# Eval("ptime") %>' /></p>
			                <p style="color:orange">
                                价格: <asp:Label ID="Label3" runat="server" Text='<%# Eval("pprice") %>' />
                                <asp:Button ID="Button2" runat="server" Text="购买" style="width:60px;height:25px;color:white;border-radius:5px;border:0;background-color:#00AEEC;margin-left:25px;"
                                    onclick="Button2_Click" CommandArgument='<%# Eval("pid") %>'/>
			                </p>
                        </div>
				    </div>
                </div>
            </ItemTemplate>
        </asp:DataList>
                </div>
            </div>
        </div>
    </form>
</body>
</html>
